import React, { Component } from "react"
import { ThemeContext } from "./context/theme-context"
import Home from "./Home"
import Profile from "./Profile"
export class App extends Component {
    constructor() {
        super()
        this.state = {
            name: "花山熏",
            info: {
                name: "baki",
                age: 18,
            },
        }
    }

    render() {
        const { name, info } = this.state

        return (
            <div>
                {/* 普通的传值方式 */}
                {/* <Home name={name} />
                <Home {...info} /> */}
                {/* 通过context传值 */}
                <ThemeContext.Provider value={{ color: "red", size: "30" }}>
                    <Home />
                </ThemeContext.Provider>
                <Profile />
            </div>
        )
    }
}

export default App
